import com.alibaba.fastjson.JSON;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.codec.digest.DigestUtils;

public class Md5Hex {

  public static void md5Hex(String digestKey,String param)  {
    String md5Hex = DigestUtils.md5Hex(digestKey + param + digestKey);
    System.out.printf("==="+md5Hex);
  }

  public static void main(String[] args) throws Exception {
    String digestKey = "1234";
    Map data = new HashMap();
    data.put("userId","1111");
    String dataJson = JSON.toJSONString(data);
    String param = dataJson;
    md5Hex(digestKey ,param);
  }
}
